#include <stdio.h>
#include <ctype.h>
#include <stdlib.h>

#define MAX_SIZE 50

int main()
{
    char c, message[MAX_SIZE], *p = message, *q = message;
    printf("Enter a message: ");
    while ((c = getchar()) != '\n' && p < message + MAX_SIZE)
        *p++ = c;
    while (p > q) {
        if (*--p != *q++) {
            printf("Not a palindrome");
            exit(1);
        }
    }
    printf("Palindrome");
    return 0;
}